<?php

class Core_Backend_Component_Promotion_View_Friendlink_Edit extends Core_Backend_Component_Promotion_View_Friendlink_Create {

    protected function buildToolbar($toolbar) {
        parent::buildToolBar($toolbar);
        if ($this->getIdentity()->isAllowAction('promotion_friendlink_review')) {
        	$status = $this->getModel()->getStatus();
            $group = $toolbar->createGroup('status');
            if ($status != "draft") {
                if ($status != 'published') {
                    $group->addButton($this->__('share.button.publish'))
                            ->bindEvent('click', "submitPublish('" . $this->getForm()->getId() . "', '" . $this->getUrl(array('ids' => array($this->getModel()->getId()), 'status' => 'published'), 'review') . "')");
                }
                if ($status != 'forbidden') {
                    $group->addButton($this->__('share.button.forbid'))
                            ->bindEvent('click', "submitForbid('" . $this->getForm()->getId() . "', '" . $this->getUrl(array('ids' => array($this->getModel()->getId()), 'status' => 'forbidden'), 'review') . "')");
                }
            }
        }
    }

    public function buildForm($form) {
      
        parent::buildForm($form);
    }

}

